package cn.edu.qvtu.rj231.lms02;

import cn.edu.qvtu.rj231.lms01.Employee;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeDAO {
    @Insert("INSERT INTO employee(id,name,age,salary) VALUES(#{id},#{name},#{age},#{salary})")
    public int add(Employee emp);

    @Select("SELECT * FROM employee")
    public List<Employee> setAll();

    @Delete("DELETE FROM employee WHERE id=#{id}")
    public  int del(long id);
}
